package com.gl.organigrama.json.dto

import org.springframework.core.io.ClassPathResource;

import com.gl.organigrama.vos.Nodo;

import groovy.text.GStringTemplateEngine

static class HTMLBodyBuilder {
	
	
	static String build(Nodo nodo){
		
		def binding = [:]
		binding.style = nodo.estilo
		binding.sigla = nodo.sigla
		binding.funcionario = nodo.funcionario.nombre
		binding.cargo = nodo.cargo
		def f = new ClassPathResource("node.template")
		def engine = new GStringTemplateEngine()
		def template = engine.createTemplate(f.file).make(binding)
		return template.toString()
	}

}
